package com.myfir.util;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBUtil {

	public static Connection getConnection() throws Exception {
		Class.forName("com.mysql.jdbc.Driver");
		String url = "jdbc:mysql://localhost:3306/myfir";
		Connection conn = DriverManager.getConnection(url, "root", "root");
		return conn;
	}

	public static void close(Connection conn) throws Exception {
		if (conn != null) {
			conn.close();
		}
	}
}
